package com.slunk.physics.characters;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.World;
import com.slunk.utilities.Movement;
import com.slunk.utilities.TrainTrack;

public class Train extends Character {
	
	public TrainTrack track;
	
	public Train(World world, Vector2 position, float boxWidth, float boxHeight, Short categoryBits, Short maskBits, float speed, Movement movement) {
		super (world, position, boxWidth, boxHeight, categoryBits, maskBits);
		this.track = null;
		this.speed = speed;
		setMovementState(movement);
		this.getCharacterBody().getFixtureList().get(0).getFilterData().groupIndex = -2;
		this.getCharacterBody().setUserData(new Boolean(false));
	}
	
	
	public Train(World world, Vector2 position, float boxWidth, float boxHeight, Short categoryBits, Short maskBits) {
		this(world,position, boxWidth, boxHeight, categoryBits, maskBits,10,Movement.EAST);
	}
	
	public Train(World world, Vector2 position, float boxWidth, float boxHeight) {
		this(world,position, boxWidth, boxHeight, null, null);
	}
	
	public void setTrainTrack(TrainTrack track) {
		this.track = track;
	}
	public TrainTrack getTrainTrack() {
		return this.track;
	}
	public void planForDecomission() {
		this.getCharacterBody().setUserData(new Boolean(true));
	}
	public void undoDecomission() {
		this.getCharacterBody().setUserData(new Boolean(false));
	}
}
